package com.Qinmeiwei.web.pojo.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the event_type table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="event_type"
 */

public abstract class BaseEventType  implements Serializable {

	public static String REF = "EventType";
	public static String PROP_ENABLED = "enabled";
	public static String PROP_DESCRIPTION = "description";
	public static String PROP_LABEL_KEY = "labelKey";
	public static String PROP_CREATE_TIME = "createTime";
	public static String PROP_TYPE_LEVEL = "typeLevel";
	public static String PROP_ID = "id";


	// constructors
	public BaseEventType () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseEventType (java.lang.String id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseEventType (
		java.lang.String id,
		java.lang.String labelKey,
		java.lang.Byte enabled,
		java.lang.Byte typeLevel,
		java.util.Date createTime) {

		this.setId(id);
		this.setLabelKey(labelKey);
		this.setEnabled(enabled);
		this.setTypeLevel(typeLevel);
		this.setCreateTime(createTime);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.String id;

	// fields
	private java.lang.String labelKey;
	private java.lang.Byte enabled;
	private java.lang.Byte typeLevel;
	private java.lang.String description;
	private java.util.Date createTime;

	// collections
	private java.util.Set<com.Qinmeiwei.web.pojo.Event> events;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="native"
     *  column="type_code"
     */
	public java.lang.String getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.String id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: label_key
	 */
	public java.lang.String getLabelKey () {
		return labelKey;
	}

	/**
	 * Set the value related to the column: label_key
	 * @param labelKey the label_key value
	 */
	public void setLabelKey (java.lang.String labelKey) {
		this.labelKey = labelKey;
	}



	/**
	 * Return the value associated with the column: enabled
	 */
	public java.lang.Byte getEnabled () {
		return enabled;
	}

	/**
	 * Set the value related to the column: enabled
	 * @param enabled the enabled value
	 */
	public void setEnabled (java.lang.Byte enabled) {
		this.enabled = enabled;
	}



	/**
	 * Return the value associated with the column: type_level
	 */
	public java.lang.Byte getTypeLevel () {
		return typeLevel;
	}

	/**
	 * Set the value related to the column: type_level
	 * @param typeLevel the type_level value
	 */
	public void setTypeLevel (java.lang.Byte typeLevel) {
		this.typeLevel = typeLevel;
	}



	/**
	 * Return the value associated with the column: description
	 */
	public java.lang.String getDescription () {
		return description;
	}

	/**
	 * Set the value related to the column: description
	 * @param description the description value
	 */
	public void setDescription (java.lang.String description) {
		this.description = description;
	}



	/**
	 * Return the value associated with the column: create_time
	 */
	public java.util.Date getCreateTime () {
		return createTime;
	}

	/**
	 * Set the value related to the column: create_time
	 * @param createTime the create_time value
	 */
	public void setCreateTime (java.util.Date createTime) {
		this.createTime = createTime;
	}



	/**
	 * Return the value associated with the column: events
	 */
	public java.util.Set<com.Qinmeiwei.web.pojo.Event> getEvents () {
		return events;
	}

	/**
	 * Set the value related to the column: events
	 * @param events the events value
	 */
	public void setEvents (java.util.Set<com.Qinmeiwei.web.pojo.Event> events) {
		this.events = events;
	}

	public void addToevents (com.Qinmeiwei.web.pojo.Event event) {
		if (null == getEvents()) setEvents(new java.util.TreeSet<com.Qinmeiwei.web.pojo.Event>());
		getEvents().add(event);
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.Qinmeiwei.web.pojo.EventType)) return false;
		else {
			com.Qinmeiwei.web.pojo.EventType eventType = (com.Qinmeiwei.web.pojo.EventType) obj;
			if (null == this.getId() || null == eventType.getId()) return false;
			else return (this.getId().equals(eventType.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}